package com.qf.day06.homework1;

import java.util.Random;

public class Hero {
    private String name;
    private int focus;
    private int intelligence;
    private int agile;

    public Hero() {
    }

    public Hero(String name, int focus, int intelligence, int agile) {
        this.name = name;
        this.focus = focus;
        this.intelligence = intelligence;
        this.agile = agile;
    }
    public void unarmedAttack(){
        Random random = new Random();
        int focusRandom=random.nextInt(40)-20+1;
        double aggressivity=this.focus*(focusRandom)*0.01+this.focus;
        System.out.println(this.name+"的本次攻击力为"+aggressivity);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getFocus() {
        return focus;
    }

    public void setFocus(int focus) {
        this.focus = focus;
    }

    public int getIntelligence() {
        return intelligence;
    }

    public void setIntelligence(int intelligence) {
        this.intelligence = intelligence;
    }

    public int getAgile() {
        return agile;
    }

    public void setAgile(int agile) {
        this.agile = agile;
    }

    @Override
    public String toString() {
        return "Hero{" +
                "name='" + name + '\'' +
                ", focus=" + focus +
                ", intelligence=" + intelligence +
                ", agile=" + agile +
                '}';
    }
}
